<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center purchaseonTop_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub purchaseonTop_fd0_0'>
          <view class='flex flex-wrap align-center purchaseonTop_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  purchaseonTop_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='purchaseonTop_fd0_0_c1_c0'>置顶发布</text>
          </view>
          <view class='flex flex-wrap align-center justify-end purchaseonTop_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout purchaseonTop_flex_1">
        <view class='flex flex-wrap align-center purchaseonTop_fd1_0'>
          <text class='purchaseonTop_fd1_0_c0'>置顶词条</text>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch purchaseonTop_fd1_1'>
          <view class='flex flex-wrap align-center'>
            <text class='purchaseonTop_fd1_1_c0_c0'>{{info.fenlei_name}}</text>
            <text class='purchaseonTop_fd1_1_c0_c0'>{{info.shuliang}}吨</text>
          </view>
          <view class='flex flex-wrap align-start purchaseonTop_fd1_1_c1'>
            <image class='purchaseonTop_fd1_1_c1_c0' v-if="info.tupian.length" mode="aspectFill" :src='info.tupian[0]'>
            </image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
              <view class='flex flex-wrap align-center'>
                <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c0_c0'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c0_c0'>{{info.buycate_mingcheng}}</text>
                </view>
                <view class='flex flex-wrap align-center flex-sub'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c0'>数量</text>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c1'>{{info.shuliang}}吨</text>
                </view>
              </view>
              <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c1'>
                <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c0_c0'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c0'>年份</text>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c1'>{{info.nianfen}}</text>
                </view>
                <view class='flex flex-wrap align-center flex-sub'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c0'>水分</text>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c1'>{{info.shuifen}}</text>
                </view>
              </view>
              <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c1'>
                <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c0_c0'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c0'>净毛</text>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c1'>{{info.buyzazhi_id_name}}</text>
                </view>
                <view class='flex flex-wrap align-center flex-sub'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c0'>地区</text>
                  <text class='purchaseonTop_fd1_1_c1_c1_c2_c1_c1'>{{info.suozaidi}}</text>
                </view>
              </view>
              <view class='flex flex-wrap align-center purchaseonTop_fd1_2_c1_c4' v-if="type==1">
                <view class="flex align-center" v-if="info.certified">
                  <image class='purchaseonTop_fd1_2_c1_c4_c0' mode="aspectFit" :src='STATIC_URL+"5.png"'></image>
                  <text class='purchaseonTop_fd1_2_c1_c4_c1'>已实名认证</text>
                </view>
                <view class="flex align-center" v-if="info.is_vip">
                  <image class='purchaseonTop_fd1_2_c1_c4_c2' mode="aspectFit" :src='STATIC_URL+"6.png"'></image>
                  <text class='purchaseonTop_fd1_2_c1_c4_c1'>VIP会员</text>
                </view>

              </view>
              <view class='flex flex-wrap align-center' v-if="type==2">
                <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c3_c0'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c3_c0_c0'>装车付款</text>
                </view>
                <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c3_c0'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c3_c0_c0'>上门看货</text>
                </view>
                <view class='flex flex-wrap align-center purchaseonTop_fd1_1_c1_c1_c3_c0'>
                  <text class='purchaseonTop_fd1_1_c1_c1_c3_c0_c0'>马上派车</text>
                </view>
              </view>
            </view>
          </view>
        </view>
        <!--     <view class='flex flex-wrap align-center purchaseonTop_fd1_2' v-if=" type=='1'">
          <image class='purchaseonTop_fd1_2_c0' mode="aspectFit" :src='info.tupian[0]'></image>
          <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
            <text class='purchaseonTop_fd1_1_c0_c0'>{{info.fenlei_name}}</text>
            <text class='purchaseonTop_fd1_2_c1_c1'>{{info.suozaidi}}</text>
            <view class='flex flex-wrap align-center purchaseonTop_fd1_2_c1_c2'>
              <text class='purchaseonTop_fd1_2_c1_c2_c0'>经营</text>
              <text class='purchaseonTop_fd1_2_c1_c2_c0'>1年</text>
              <text class='purchaseonTop_fd1_2_c1_c2_c0'>丨距您</text>
              <text class='purchaseonTop_fd1_2_c1_c2_c0'>14.5km</text>
            </view>
            <view class='flex flex-wrap align-center purchaseonTop_fd1_2_c1_c3'>
              <text class='purchaseonTop_fd1_2_c1_c3_c0'>玉米，小麦</text>
              <view class='flex flex-wrap align-center purchaseonTop_fd1_2_c1_c3_c1'>
                <text class='purchaseonTop_fd1_1_c1_c1_c3_c0_c0'>过筛</text>
              </view>
              <view class='flex flex-wrap align-center purchaseonTop_fd1_2_c1_c3_c1'>
                <text class='purchaseonTop_fd1_1_c1_c1_c3_c0_c0'>色选</text>
              </view>
            </view>
            <view class='flex flex-wrap align-center purchaseonTop_fd1_2_c1_c4'>
              <image class='purchaseonTop_fd1_2_c1_c4_c0' mode="aspectFit" :src='STATIC_URL+"5.png"'></image>
              <text class='purchaseonTop_fd1_2_c1_c4_c1'>已实名认证</text>
              <image class='purchaseonTop_fd1_2_c1_c4_c2' mode="aspectFit" :src='STATIC_URL+"5.png"'></image>
              <text class='purchaseonTop_fd1_2_c1_c4_c1'>VIP会员</text>
            </view>
          </view>
        </view> -->
        <view class='flex flex-direction flex-wrap align-stretch purchaseonTop_fd1_1'>
          <view class='flex flex-wrap align-center'>
            <text class='purchaseonTop_fd1_3_c0_c0'>订单编号</text>
            <text class='purchaseonTop_fd1_1_c1_c1_c0_c1_c1'>{{orderInfo.dingdanhao}}</text>
          </view>
          <view class='flex flex-wrap align-center purchaseonTop_fd1_3_c1'>
            <text class='purchaseonTop_fd1_3_c0_c0'>订单名称</text>
            <text class='purchaseonTop_fd1_3_c1_c1'>置顶发布</text>
          </view>
          <view class='flex flex-wrap align-center purchaseonTop_fd1_3_c1'>
            <text class='purchaseonTop_fd1_3_c0_c0'>订单金额</text>
            <text class='purchaseonTop_fd1_3_c2_c1'>￥</text>
            <text class='purchaseonTop_fd1_3_c2_c1'>{{orderInfo.jiage}}</text>
          </view>
        </view>
        <view class='flex flex-direction flex-wrap align-stretch purchaseonTop_fd1_4'>
          <view class='flex flex-wrap align-center purchaseonTop_fd1_4_c0'>
            <text class='purchaseonTop_fd1_4_c0_c0'>支付方式</text>
          </view>
          <benben-select-diy ref="showSelectPopup1706608877342" class-name='flex flex-direction align-stretch flex'
            :items.sync="payType" v-model="pay_id" default-type="value" default-label="name" :allow-cancel='false'
            type="radio" :disabled='false'>
            <template v-for='(item,key0) in payType'>
              <view v-if="item.isSelected" class='flex align-center justify-between flex purchaseonTop_fd1_4_c1_c0'
                :key="key0" @tap="$refs.showSelectPopup1706608877342.tapHandle(key0)">
                <view class='flex flex-wrap align-center'>
                  <image class='purchaseonTop_fd1_4_c1_c0_c0_c0' mode="aspectFit" :src='item.image'></image>
                  <text class='purchaseonTop_fd1_4_c1_c0_c0_c1'>{{item.name}}</text>
                </view>
                <image class='purchaseonTop_fd1_4_c1_c0_c1' mode="aspectFit" :src='STATIC_URL+"137.png"'></image>
              </view>
              <view v-else class='flex align-center justify-between flex purchaseonTop_fd1_4_c1_c0' :key="key0"
                @tap="$refs.showSelectPopup1706608877342.tapHandle(key0)">
                <view class='flex flex-wrap align-center'>
                  <image class='purchaseonTop_fd1_4_c1_c0_c0_c0' mode="aspectFit" :src='item.image'></image>
                  <text class='purchaseonTop_fd1_4_c1_c0_c0_c1'>{{item.name}}</text>
                </view>
                <image class='purchaseonTop_fd1_4_c1_c0_c1' mode="aspectFit" :src='STATIC_URL+"27.png"'></image>
              </view>
            </template></benben-select-diy>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex purchaseonTop_flex_2">
        <view class='flex flex-wrap align-center justify-between flex-sub purchaseonTop_fd2_0'>
          <view class='flex flex-wrap align-end'>
            <text class='purchaseonTop_fd2_0_c0_c0'>应付：</text>
            <text class='purchaseonTop_fd2_0_c0_c1'>￥</text>
            <text class=' purchaseonTop_fd2_0_c0_c2'>
              <text class=' purchaseonTop_price1_fd2_0_c0_c2'>{{orderInfo.jiage}}</text>
              <!-- <text class=' purchaseonTop_price2_fd2_0_c0_c2'>{{ 9.99 | laterPrice }}</text> -->
            </text>
          </view>
          <button class='purchaseonTop_fd2_0_c1' @tap.stop="goPay" data-type="navigateTo"
            :data-url="`/pages/fabu/paymentSuccessful/paymentSuccessful`">确认支付</button>
        </view>

      </view>
      <view :style="{height: '90rpx'}"></view>


    </view>
  </view>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        // "payType": [{
        //   "name": "微信支付",
        //   "value": "1",
        //   "image": require('@/static/images/23.png')
        // }],
        "payType": [{
          "name": "支付宝支付",
          "value": "1",
          "image": require('@/static/images/178.png')
        }],
        "pay_id": "1",
        "aid": "",
        "type": "1",
        info: '',
        tpian: [],
        orderInfo: ''
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        aid,
        type
      } = options
      if (aid !== undefined) this.aid = aid
      if (type !== undefined) this.type = type
      this.getData(aid)
      this.getTop()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      async goPay() {
        let data62e335233b477 = await this.$api.post(global.apiUrls.post645cc048d1f34, {
          order_sn: this.orderInfo.dingdanhao
        })
        if (data62e335233b477.data.code != 1) {
          this.$message.info(data62e335233b477.data.msg);
          return
        }
        console.log('data62e335233b477.data.data', data62e335233b477.data.data)
        await this.requestPaymentAli(data62e335233b477.data.data)
        this.$urouter.reLaunch(`/pages/fabu/paymentSuccessful/paymentSuccessful`);
      },
      getTop() {
        this.$api.post(global.apiUrls.post65d44e2f3886d, {
          leixing: '2',
          buy_id: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.orderInfo = res.data.data
            // this.goPay(res.data.data.dingdanhao)
          }
        })
      },
      getData() {
        this.$api.post(global.apiUrls.post656ef5107cf32, {
          aid: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.info = res.data.data
            this.tpian = this.info.tupian
          }
        })
      },
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(248, 248, 250, 1);
    background-size: 100% auto;
  }

  .purchaseonTop_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .purchaseonTop_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .purchaseonTop_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .purchaseonTop_fd0_0_c0 {
    width: 120rpx;
  }

  .purchaseonTop_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .purchaseonTop_flex_1 {
    padding: 32rpx 32rpx 71rpx 32rpx;
  }

  .purchaseonTop_fd1_4_c1_c0_c1 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_4_c1_c0_c0_c1 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_4_c1_c0_c0_c0 {
    width: 56rpx;
    height: 56rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_4_c1_c0 {
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .purchaseonTop_fd1_4_c0_c0 {
    color: #666666;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_4_c0 {
    border-bottom: 1px solid #eee;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .purchaseonTop_fd1_4 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .purchaseonTop_fd1_3_c2_c1 {
    color: #FF5050;
    font-size: 30rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_3_c1_c1 {
    color: #101010;
    font-size: 30rpx;
    font-weight: 700;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_3_c1 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_3_c0_c0 {
    color: #999999;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 50rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2_c1_c4_c2 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 16rpx 0rpx 34rpx;
  }

  .purchaseonTop_fd1_2_c1_c4_c1 {
    color: #C86105;
    font-size: 26rpx;
    font-weight: 400;
    line-height: 26rpx;
  }

  .purchaseonTop_fd1_2_c1_c4_c0 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2_c1_c4 {
    margin: 17rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2_c1_c3_c1 {
    background: rgba(244, 247, 255, 1);
    margin: 0rpx 0rpx 0rpx 24rpx;
    padding: 4rpx 14rpx 4rpx 14rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
  }

  .purchaseonTop_fd1_2_c1_c3_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_2_c1_c3 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2_c1_c2_c0 {
    color: rgba(153, 153, 153, 1);
    font-size: 24rpx;
    font-weight: 400;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_2_c1_c2 {
    margin: 10rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2_c1_c1 {
    color: #666666;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 28rpx;
    margin: 14rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2_c0 {
    width: 220rpx;
    height: 266rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_2 {
    background: rgba(255, 255, 255, 1);
    padding: 32rpx 24rpx 32rpx 24rpx;
    border-radius: 16rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
    background-size: 100% auto;
  }

  .purchaseonTop_fd1_1_c1_c1_c3_c0_c0 {
    color: #667D91;
    font-size: 24rpx;
    font-weight: 500;
    line-height: 24rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c3_c0 {
    background: rgba(244, 247, 255, 1);
    padding: 4rpx 14rpx 4rpx 14rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
    margin: 24rpx 15rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c2_c1_c1 {
    color: #101010;
    font-size: 30rpx;
    font-weight: 500;
    line-height: 32rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    width: 137rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c1 {
    margin: 20rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c0_c1_c1 {
    color: #101010;
    font-size: 30rpx;
    font-weight: 500;
    line-height: 32rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c0_c1_c0 {
    color: #999999;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c0_c0_c0 {
    color: #101010;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 32rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_1_c1_c1_c0_c0 {
    width: 180rpx;
  }

  .purchaseonTop_fd1_1_c1_c0 {
    width: 190rpx;
    height: 235rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_1_c1 {
    margin: 21rpx 0rpx 0rpx 0rpx;
  }

  .purchaseonTop_fd1_1_c0_c0 {
    color: #101010;
    font-size: 34rpx;
    font-weight: 500;
    line-height: 34rpx;
  }

  .purchaseonTop_fd1_1 {
    background: rgba(255, 255, 255, 1);
    padding: 32rpx 24rpx 32rpx 24rpx;
    margin: 0rpx 0rpx 24rpx 0rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
  }

  .purchaseonTop_fd1_0_c0 {
    color: #333333;
    font-size: 36rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .purchaseonTop_fd1_0 {
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .purchaseonTop_flex_2 {
    background: rgba(255, 255, 255, 1);
    width: 750rpx;
    height: 90rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto;
  }

  .purchaseonTop_fd2_0_c1 {
    background: rgba(37, 104, 174, 1);
    border-radius: 0rpx;
    width: 280rpx;
    line-height: 90rpx;
    font-size: 32rpx;
    color: #fff;
  }

  .purchaseonTop_price2_fd2_0_c0_c2 {
    font-size: 28rpx;
  }

  .purchaseonTop_price1_fd2_0_c0_c2 {
    font-size: 56rpx;
  }

  .purchaseonTop_fd2_0_c0_c2 {
    color: #ff5536;
    font-weight: 600;
    line-height: 42rpx;
  }

  .purchaseonTop_fd2_0_c0_c1 {
    color: #EF3A3A;
    font-size: 22rpx;
    font-weight: 700;
    line-height: 42rpx;
  }

  .purchaseonTop_fd2_0_c0_c0 {
    color: #1A1A1A;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 44rpx;
  }

  .purchaseonTop_fd2_0 {
    padding: 0rpx 0rpx 0rpx 32rpx;
  }
</style>
